import { Avatar } from "antd"
import { UserOutlined } from '@ant-design/icons';
import { history } from '@umijs/max';

type Props ={
    size:number,
    userId:string,
    avatar:string,
}
export default ({
    size,
    userId,
    avatar,
}:Props) =>{
    return <Avatar size={size} icon={<UserOutlined />} src={avatar} onClick={(e)=>{
        e?.stopPropagation()
        history.push(`/user/${userId}`)
    }}/>
}